Skip to content

[Jira] JiraCloud: enhanced_jql uses the configured api_version - #1724

Merged
gonchik merged 1 commit into
atlassian-api:masterfrom
hnwg:jira-cloud-enhanced-jql-api-version
Nov 18, 2026
Merged

gonchik merged 1 commit into
atlassian-api:masterfrom
hnwg:jira-cloud-enhanced-jql-api-version

Conversation

@hnwg

@hnwg hnwg commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #1717.

As JiraCloud.enhanced_jql() was hardcoded with api_version=3, a client with api_version=2 still got v3 responses from it. According to the Atlassian platform REST API spec, GET/POST /rest/api/2/search/jql exists (enhanced search is available in v2). However, I checked this against the spec only (not a live site). The method now uses the api_version from the client. If unspecified, the default is still version 3. If a client specifies version 2, then version 2 payloads are now returned from this method. The documentation now says the same.

The updated test fails on master with Actual: get('rest/api/3/search/jql', ...). pytest tests/test_jira.py tests/test_jira_cloud_clients.py: 67 passed.

The legacy Jira client keeps its fixed v3 URL. Its default is "2", so following it would result in different responses for existing users of this client. The comment indicates that this endpoint is version 3 only, but according to the spec this is incorrect. I can change either one here, depending on your preference.

enhanced_jql used to call the v3 endpoint every time. It will now make requests
to the v2 endpoint if the JiraCloud client has been instantiated with
api_version=2, and those clients will receive v2 responses. For default
clients (api_version=3) the request is unchanged.

Fixes atlassian-api#1717
@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.54%. Comparing base (f7381ca) to head (ee4aef5).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1724      +/-   ##
==========================================
+ Coverage   65.52%   65.54%   +0.01%     
==========================================
  Files         107      107              
  Lines       19462    19462              
  Branches     2132     2132              
==========================================
+ Hits        12753    12756       +3     
  Misses       6000     6000              
+ Partials      709      706       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gonchik
gonchik merged commit 5ec72dd into atlassian-api:master Nov 18, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Jira] search/jql api enforces rest api v3

2 participants